Adjust emacsVER-common.README to accomodate new patch headers.
authorRob Browning <rlb@defaultvalue.org>
Fri, 8 Apr 2011 04:35:20 +0000 (23:35 -0500)
committerRob Browning <rlb@defaultvalue.org>
Fri, 8 Apr 2011 04:45:28 +0000 (23:45 -0500)
Add debian/patch-to-news to handle converting new git-dpm style patch
headers to emacsVER-common.README.

debian/patch-to-news [new file with mode: 0755]
debian/rules

diff --git a/debian/patch-to-news b/debian/patch-to-news
new file mode 100755 (executable)
index 0000000..309fec3
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+patch="$1"
+
+sed '
+  # delete everything after the first line starting with "--- " (the diff)
+  /^--- [^ ]/,$d' < "$patch" \
+| tac \
+| sed '
+  # delete everything up to the first line containing only "---" (the diffstat)
+  1,/^---$/d' \
+| tac \
+| sed '
+  # delete everything before the first blank line (git summary line)
+  1,/^$/d' \
+| sed '
+  # convert to our README.Debian NEWS format
+  1 s/^/* /
+  2,$ s/^/  /'
+
+echo "  Patch: $(basename $patch)"
index 9b8337d461c5002928235029271cdae5ab952cd1..6e2639689d5f1a00833db1a67bed1f9afe41cf4c 100755 (executable)
@@ -413,13 +413,17 @@ debian/$(flavor)-lucid.%: debian/emacsVER.% debian/changelog
        $(call deb_sub,$<,$@)
 
 debian/$(flavor)-common.README.Debian: \
-  debian/emacsVER-common.README debian/patches/*.diff debian/patches/series
+  debian/emacsVER-common.README debian/patches/*.patch debian/patches/series \
+  debian/rules debian/patch-to-news
        cd debian && \
          csplit -s -f emacsVER-common.README. \
          emacsVER-common.README '/@@PATCH_LIST_HERE@@/'
        cp debian/emacsVER-common.README.00 debian/emacsVER-common.README.tmp
-       for p in $$($(quilt) series); do $(quilt) header $$p; done \
-         >> debian/emacsVER-common.README.tmp
+       for p in $$($(quilt) series); do \
+         debian/patch-to-news debian/patches/$$p \
+           >> debian/emacsVER-common.README.tmp; \
+         echo >> debian/emacsVER-common.README.tmp; \
+       done
        tail -n +2 \
          < debian/emacsVER-common.README.01 \
          >> debian/emacsVER-common.README.tmp